#include <memory>
#include "tcp_server.hpp"

static void usage(std::string proc)
{
    std::cout << std::endl
              << "Usage: " << proc << " port" << std::endl
              << std::endl;
}

// ./tcp_server port
int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        usage(argv[0]);
        exit(1);
    }
    uint16_t port = atoi(argv[1]);

    std::unique_ptr<TcpServer> unqPtrSvr(new TcpServer(port));

    unqPtrSvr->initServer();
    unqPtrSvr->start();

    return 0;
}